/**
 * copyright © geolabs 2007
 * author: Gérald Fenoy gerald [ at ] geolabs [dot] fr
 * 
 */

Keyboard=Class.create({
  keys: {
    BACKSPACE: 8,
    TAB:       9,
    RETURN:   13,
    MAJ:      16,
    CTRL:     17,
    ATL:      18,
    ESC:      27,
    SPACE:    32,
    LEFT:     37,
    UP:       38,
    RIGHT:    39,
    DOWN:     40,
    DELETE:   46
	},

  getKey: function(e){
      var e=window.event? event : e;
      var unicode=e.charCode? e.charCode : e.keyCode;
      for(i in this.keys)
	if(this.keys[i]==unicode)
	  return i;
      return String.fromCharCode(unicode);
    }
  });
